const seq = require('../../seq')
const {STRING, INTEGER, DECIMAL, BOOLEAN, TEXT} = require('../../types')

const House = seq.define('house', {
  name: {
    type: STRING,
    allowNull: false,
    comment: '房租名字'
  },
  address: {
    type: STRING,
    allowNull: false,
    comment: '地址'
  },
  rent: {
    type: INTEGER,
    allowNull: false,
    comment: '租金'
  },
  areaId: {
    type: INTEGER,
    allowNull: false,
    comment: '地区id'
  },
  uid: {
    type: INTEGER,
    allowNull: false,
    comment: '房东id'
  },
  askId: {
    type: INTEGER,
    allowNull: true,
    comment: '住户id'
  },
  isSchool: {
    type: BOOLEAN,
    defaultValue: false,
    comment: '是否是学区房'
  },
  schoolId: {
    type: INTEGER,
    comment: '所在的学校id'
  },
  status: {
    type: DECIMAL,
    allowNull: false,
    comment: '状态：1-下架 2-上架 3-已出租'
  },
  imgs: {
    type: TEXT,
    allowNull: true,
    comment: '房屋相关照片'
  },
  description: {
    type: TEXT,
    allowNull: true,
    comment: '房屋相关描述'
  }
})

module.exports = House
